home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 9
/
Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO
/
050a
/
s3data10.zip
/
L2R10.DOC
< prev
next >
Wrap
Text File
|
1992-02-27
|
6KB
|
127 lines
Program: L2R - Line to Record
Version: 1.0
Author: George Spafford
Date: February 27, 1992
Purpose:
To convert 1 line:1 field data to either fixed length or delimitted format.
Procedure:
To convert a single file:
Run L2R and the answer the prompts concerning the input and output file names.
The output file name can be a device if so desired. The program will then
prompt you for the number of lines to a record. If it takes eight lines of
source data to make a record, then answer eight to this prompt.
The program then asks if you wish to create a delimitted or fixed length ASCII
file. If you want a fixed length, the program will prompt you for the maximum
length of each field (all fields must be equal to or less than this number) and
it will the process the data. L2R will display the size of the fixed length
record that it is creating. If you do not know the length of your longest
field, put a 0 (Zero) in for the record length and L2R will determine the
longest length required.
Delimitted asks for a little bit information.
One of the first things required for a delimitted file to be created is the
delimitter symbol itself. This is frequently a comma (,) a pipe (|) or the
colon (:) character. It can be whatever you want. This is what will separate
data fields.
0123|BOB|ARLLEY|33 PALM GROVE ROAD|AUGUSTA|MI|49015
In this example, the vertical pipe serves as the field delimitter.
The next thing it asks is if you want literals or not. "Literals" occur when
you place text in double quotes thus exempting encapsulated data from any
misinterpretation during the importation process. For example, if your
delimitter is a comma, and you have a comma in one of your fields, then that
field should be enclosed in double quotes. Example
9999,Bob,Herowitz,"30001 Rivershore, Apt 339",etc
Because of the quotes around the fourth field, the internal comma will be
ignored. This does depend on your software however.
The last thing asked, involves the trimming of leading and trailing spaces. If
you want the spaces removed, answer yes to this prompt.
BATCH PROCESSING:
L2R can use the L2R.CFG file to store predefined options. The input and the
output file names can be specified on the command line along with a /B that
tells L2R to do unattended processing.
L2R Input.Dat Output.fix [/B] [/B:Config.fil]
If /B is used, then L2R.CFG is assumed to be the configuration file.
The L2R.CFG is made up of the following lines:
1. Lines per record
2. Maximum field width or (0) to let the software determine
the maximum field length.
3. The Delimitter character (!,|~@# etc)
4. L if you want literals or blank if you do not.
5. C if you want to compress trailing/Leading spaces or
blank if you do not.
L2R reads the first 5 bytes of each line of the .CFG file. If it does not find
the info then it will not process it. If a delimitter is not found, then the
record format will be assumed to be fixed length.
Example:
8 :Lines per input record that will be combined into 1 output rec
0 :Fixed label width for fixed length records
| :Field Delimitter (if this field doesn't exist, fixed len is assumed)
L :Encapsulate Fields with double quotes? (if not fixed len)
C :Compress leading/trailing blanks from input fields.
The above will process 8 field records, NOT fixed length, it will use the
vertical pipe for the delimitter, it will enclose fields with double quotes and
it will compress leading and trailing spaces.
/B:config.fil
This is for when you may need to process several different types of files.
Config.fil is the name of the configuration file that you want to use. The
configuration files follow the data format laid out for L2R.CFG.
Remember, even if you do not use all 5 lines in the config file, you MUST HOLD
THE LINE OPEN EVEN IF IT IS BLANK. I recommend just having the first five
characters blank if you do not need the field.
I hope this program helps you evaluate some of your problems
or even makes some solutions/benefits clear. This program is
released as shareware. Its price is $5 for each concurrently
used copy. If you have any suggestions or comments, I'd REALLY
like to hear those too.
Sincerely,
George Spafford
3001 LakeShore Drive, #329
St. Joseph, MI 49085
Data: (616) 468-5026 Queued Access BBS 14.4Kb USR Dual HST
FIDOnet: 1:2340/0 NEC/NC Site.
Sysop: Tim Akright
And now for the unpleasantries:
Code CopyRight: February 1992
L2R IS DISTRIBUTED AS IS. THE AUTHOR (GEORGE SPAFFORD) MAKES NO
WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
WITH RESPECT TO THIS SOFTWARE AND DOCUMENTATION. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DAMAGES, INCLUDING LOST PROFITS, LOST
SAVINGS, OR ANY OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OF OR THE INABILITY TO USE THIS PROGRAM.
----------------------------------------------------------------